/*
    COMP9517 Computer Vision, Semester 2, 2011 - University of New South Wales
   ============================================================================
   |   Group .  | Christian Mostegel & Dong Back Kim                          |
   ============================================================================
 */

#ifndef ANALYZEDIMAGE_H_
#define ANALYZEDIMAGE_H_

#include "opencv2/opencv.hpp"
#include <QtCore>
#include "Track.h"
#include "Parameters.h"
#include "KDTree.h"

class AnalyzedImage {
public:
	AnalyzedImage();
	AnalyzedImage(cv::Mat * image_ptr);
	virtual ~AnalyzedImage();

	cv::Mat rgb_image;
	cv::Mat bw_image;
	std::vector<cv::KeyPoint> keypoints;
	cv::Mat desc;
        KDTree * kd_tree;
        QMap< unsigned int, unsigned int> kp2trackID;
        QMap< unsigned int, cv::Mat > imageID2F;
        void setPose(cv::Mat K,cv::Mat R, cv::Mat T);
        void setPose(Parameters* params);
        cv::Mat getR(){return _R;}
        cv::Mat getK(){return _K;}
        cv::Mat getT(){return _T;}
        cv::Mat getP(){return _P;}
        cv::Mat getModelT();
        bool isPoseSet(){return _is_pose_set;}
        cv::Point2f getPrincipalPoint(){return _principal_point;}
        void setPrincipalPoint(cv::Point2f pp){ _principal_point = pp; }

private:
        cv::Point2f _principal_point;
        cv::Mat _P;
        //cv::Mat params; //[rx,ry,rz,tx,ty,tz,fx,fy,vx,vy]
        cv::Mat _K;
        cv::Mat _R;
        cv::Mat _T;
        bool _is_pose_set;
};

#endif /* ANALYZEDIMAGE_H_ */
